-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix (target start): curveadm target start timeout #364
Fix (target start): curveadm target start timeout #364
Conversation
@zztaki We recommend modifying the commit message Fix(target start): ... and It will greatly improve convenience and readability. |
internal/task/task/bs/start_tgtd.go
Outdated
@@ -127,7 +127,7 @@ func NewStartTargetDaemonTask(curveadm *cli.CurveAdm, cc *configure.ClientConfig | |||
ExecOptions: curveadm.ExecOptions(), | |||
}) | |||
t.AddStep(&step.ContainerExec{ | |||
Command: "tgtd -f &", | |||
Command: "-d tgtd -f &", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe modify the step of ContainerExec it better?
ContainerExec{
Command: "tgtd -f",
Detached: true,
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it's attractive! I didn't notice there was this option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you need to add it, now it doesn't support --detach
option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no problem!
Signed-off-by: zztaki <[email protected]>
28bc0b9
to
ed38480
Compare
LGTM! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Related to this issue.
In curve tgt deployment, we start the tgtd daemon on the specified host using
curveadm target start --host target-host -c client.yaml
. This command will timeout but in fact, the tgtd has been started.Looking through these codes, I found this command is mainly executed by
sudo docker exec <ContianerId> tgtd -f &
on the remote host and we need to wait its returns (combined stdout and stderr) to end with no error. But sincesudo docker exec <ContianerId> tgtd -f &
executes in non-detached mode, it will occupy its stdout, which causes the callback function can't return and then timeout.So, I try to add
-d
parameter to ContainerExec, which makes tgtd running in detached mode correctly.